<?php
	include('../PlurkAPI.php');
	$api_key = 'yYsxraBDrokpOvfDSkQT8hc0ySHxKxIx';
	$MyPlurk = new PlurkAPI();
	$MyPlurk->InitPlurk($api_key);

	$path = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
	if($_SERVER['SCRIPT_NAME'] != dirname($_SERVER['SCRIPT_NAME']).'/login.php') {
		if($_COOKIE['username'] == '' && $_COOKIE['password'] == '') {
			header('Location: '.$path.'/login.php');
			exit;
		} 
		$username = $_COOKIE['username'];
		$password = $_COOKIE['password'];	
		$MyPlurk->LoginPlurk($username, $password);
	}
?>
<html>
<head>
<title>MyPlurk</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<style type="text/css">
body {
	font-family: Tahoma;
	font-size: 100%;
	background-color: #75848B;
	margin-left: 5px;
	margin-right: 5px;
	padding: 0px;
}
.navigation {
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px;	
	background-color: #CC3300;
	color: #FFFFFF;	
}
.user_info {
	background-color: #FFFFFF;
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px;
	height: auto;
	width: auto;
}
.plurk {
	/*border: 1px solid #ccc;*/
	padding: 5px;
	margin-top: 5px;
	margin-bottom: 5px;
	background-color: #FFFFFF;
/*	clear: both;
	height: auto;*/
}
.plurk_avatar {
	vertical-align: middle;
/*	float: left;*/
}
.plurk-response_by_me {
	background-color: #FFD2D2;
}
.plurk-response_by_owner {
	background-color: #FFCC99;
}
.qualifier {
	background-color: #006699;
	padding-top: 0pt;
	padding-right: 3px;
	padding-bottom: 0pt;
	padding-left: 3px;
	color: white;
	margin-top: 0pt;
	margin-right: 3px;
	margin-bottom: 0pt;
	margin-left: 4px;	
}
.form_plurk {
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px;
	background-color: #FF9933;	
}
.form_status {
	width:100%;
}
.footer {
	margin-top: 10px;
	margin-bottom: 10px;
	text-align: center;
}
</style>
</head>
<body>
<!--<h1>MyPlurk</h1>-->
<div class="navigation">
<?php if($_COOKIE['username'] != '') { ?>
	<a href="index.php">Home</a> |
	<a href="index.php?mode=responded">Responded Plurks</a> |       
	<a href="index.php?mode=unread">Unread Plurks</a> |      
	<a href="login.php?logout=1">Logout</a>
<?php } ?>
</div>